package cn.tedu.csmall.product.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@Accessors(chain = true)
public class AlbumAddNewParam implements Serializable {

    /*
    * @ApiModelProperty注解用在控制器里方法中封装的参数的属性值上
    * 是knife4j文档的注解
    * value表示字段说明,
    * required表示是否必须，
    * example表示示例值
    * */
    /*@NotNull 是Validation中的注解*/
    @NotNull(message = "必须提交相册名称！")
    @ApiModelProperty(value = "相册名称",required = true,example = "篮球的相册")
    private String name;

    @NotNull(message = "必须提交相册简介！")
    @ApiModelProperty(value = "相册简介",required = true,example = "篮球相册的简介")
    private String description;

    @NotNull(message = "必须提交排序序号")
    @Range(max = 99,message = "排序序号值必须0~99之间")
    @ApiModelProperty(value = "排序序号，必须是1~99之间的数字",required = true,example = "95")
    private Integer sort;

}
